package com.zqh.web.controller.chat;


import com.zqh.web.model.dto.chat.ChatMsg;
import com.zqh.web.model.dto.chat.ChatRoomMsgList;
import com.zqh.web.model.entity.Msg;
import com.zqh.web.service.ChatService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
//@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/chat")
@Tag(name = "AI对话工具")
public class ChatController {


    private  final ChatService chatService;


    @PostMapping("/startAiChat")
    @Operation(summary = "开始猜谜游戏AI对话")
    public String startAiChat(@RequestBody ChatMsg chatMsg) {

        return chatService.doChat(chatMsg);
    }

    @GetMapping("/getAllChatRoom")
    @Operation(summary = "获取所有聊天室")
    public List<ChatRoomMsgList>  getAllChatRoom() {

        return chatService.getChatRoomList();
    }




}
